﻿namespace Leo.Common.MQ
{
    public class MessageModel<T> : IMessageModel
    {

        public MessageModel(string destination, T data, MessageProperty property = null)
        {
            this.destination = destination;
            this.Data = data;
            this.msgProperty = property;
        }


        public T Data { get; set; }


        public string GetDestination()
        {
            return this.destination;
        }


        public string GetMessageJson()
        {
            //TODO: 待优化
            //return JSON.Serialize(this.Data);
            return null;
        }


        public string GetMessageType()
        {
            return typeof(T).FullName;
        }


        public MessageProperty GetProperties()
        {
            return this.msgProperty;
        }


        private readonly string destination;


        private readonly MessageProperty msgProperty;
    }
}
